/* 淡绿色主题样式表 */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 100%;
    margin: 0 auto;
    background-color: #e3f0ff;
    /* 淡绿色背景 */
    padding: 20px;
}

.container {
    background-color: #8cd98c;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

h1,
h2,
h3 {
    color: #2d5d2c;
    /* 深绿色标题 */
    margin-top: 30px;
    margin-bottom: 20px;
}

/* 导航按钮 */
.nav-buttons {
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #45a049;
}

/* 浮动按钮样式 */
.floating-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
}

.floating-btn button {
    width: 50px;
    height: 50px;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.floating-btn button:hover {
    background-color: #45a049;
}

/* 菜单样式 */
.menu {
    list-style-type: none;
    position: absolute;
    bottom: 60px;
    right: 0;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    display: none;
    z-index: 1001;
}

.menu li {
    display: none;
    text-align: center;
    border-bottom: 1px solid #eee;
    width: 150px;
}

.menu li:last-child {
    border-bottom: none;
}

.menu a {
    color: #333;
    text-decoration: none;
    display: block;
}

.menu a:hover {
    background-color: #f1f1f1;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background-color: #f9f9f9;
}

.form-control:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.checkbox-label {
    display: block;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.form-checkbox {
    width: auto;
    margin-right: 10px;
}

.checkbox-label:hover {
    border-color: #4CAF50;
}

.card {
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* 响应式表格 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    th {
        display: none;
    }

    td {
        position: relative;
        padding-left: 50%;
        border: none;
        border-bottom: 1px solid #ddd;
        white-space: nowrap;
    }

    td::before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        font-weight: bold;
    }

    .btn {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }

    .form-control {
        font-size: 16px;
    }

    .floating-btn {
        right: 10px;
        bottom: 10px;
    }

    .floating-btn button {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .floating-btn .menu {
        bottom: 50px;
    }
}

input[type="text"],
input[type="number"] {
    border-radius: 3px;
    padding: 8px;
    border: 1px solid #ccc;
    margin: 5px 0;
    width: 100%;
    line-height: 26px;
    font-size: 16px;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* 新增：表单行样式，用于将相关字段放在同一行 */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Mobile-first styles */

/* 设置默认字体大小和盒模型 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    padding: 10px;
}

/* 图片和媒体元素自适应 */
img,
video,
canvas {
    max-width: 100%;
    height: auto;
}

/* 容器设置为最大宽度100%，以便在小设备上滚动查看 */
.container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* 表格响应式处理 */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 8px;
    text-align: left;
    min-width: 120px;
}

/* 媒体查询 - 针对大一点的屏幕调整 */
@media (min-width: 600px) {
    body {
        font-size: 18px;
    }

    .container {
        max-width: 600px;
        margin: auto;
    }
}

/* 支出记录卡片布局 */
.expenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    margin: 20px 0;
}

.expense-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    min-height: 100px;
}

.expense-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.expense-date {
    font-size: 16px;
    font-weight: bold;
    color: #666;
    margin-bottom: 8px;
}

.del-mini-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;


}

.del-mini-div {
    margin-bottom: 8px;
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #b1b1b1;
    padding: 4px 8px;
    border-radius: 3px;
}


.expense-amount {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    position: absolute;
    bottom: 8px;
    right: 15px;
}

.expense-description {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
    overflow-wrap: anywhere;
    margin-top: 8px;
}

/* 统计信息样式 */
.stats-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stats-half {
    flex: 1;
}

.stats-title {
    font-size: 18px;
    margin: 0 0 10px 0;
}

.stats-amount {
    font-size: 48px;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}

.expense {
    color: #b75454;
}

.income {
    color: #007114;
}

.budget {
    color: #007114;
}

/* 新增：分隔线样式 */
.divider {
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgb(187 187 187) 50%, rgba(255, 255, 255, 0) 100%);
    margin: 0 20px;
}

/* 新增：统一select样式与input样式一致 */
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background-color: #f9f9f9;
    appearance: none;
    /* 移除默认样式 */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .expenses-grid {
        grid-template-columns: 1fr;
    }

    .expense-card {
        padding: 12px;
    }

    .expense-amount {
        font-size: 16px;
    }

    .stats-amount {
        font-size: 24px;
    }

    .stats-item {
        flex-direction: row;
    }

    .divider {
        height: 80px;
        margin: 0 15px;
    }
}